import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;


// 一个集合中
//	 *  分别存储了6个男演员
//	 *  和6名女演员.
//	 *  男演员只要名字为3个字的前面三人
//	 *  女演员只要姓林的,并且不要第一个
//	 *  把过滤后的男演员和女演员姓名结合在一起
//		ArrayList<String> list = new ArrayList<String>();
//		Collections.addAll(list, "张无忌-男-15", "周芷若-女-14", "赵敏-女-13", "张强-男-20", "张三丰-男-100", "张翠山-男-40","张良-男-35","王二麻子-男-35","谢广坤-女-41","林婷-女-22","林立-女-23");
//

public class Java002 {
    public static void main(String[] args) {
        ArrayList<String> list = new ArrayList<String>();
        Collections.addAll(list, "张无忌-男-15", "周芷若-女-14", "赵敏-女-13", "张强-男-20", "张三丰-男-100", "张翠山-男-40","张良-男-35","王二麻子-男-35","谢广坤-女-41","林婷-女-22","林立-女-23");
        ArrayList<String> endList = new ArrayList<String>();
        int man=3,woman=3,flag=1;//需要多少男生和女生

        List<String> listMan = list.stream().filter(s -> "男".equals(s.split("-")[1]) && s.split("-")[0].length() == 3).collect(Collectors.toList());

        List<String> listWoman = list.stream().filter(s -> "女".equals(s.split("-")[1]) && s.split("-")[0].charAt(0) == '林').skip(1).collect(Collectors.toList());

        List<String> listEnd = new ArrayList<>();
        listEnd.addAll(listMan);
        listEnd.addAll(listWoman);
        System.out.println(listEnd);

        System.out.println("======");
        System.out.println("没有方法的引用");
    }
}
